<template>
  <div class="app-container">
    <wise-crud ref="wise-crud" :urls="urls" :fields="fields"></wise-crud>
  </div>
</template>

<script>
import WiseCrud from '@/components/Crud/wiseCrud'
export default {
  name: 'DepartmentManage',
  components: { WiseCrud },
  data() {
    return {
      urls: {
        list: '/api/v1/welder-uac-second/base-organization',
        add: '/api/v1/welder-uac-second/base-organization/create',
        show: '/api/v1/welder-uac-second/base-organization/show/',
        update: '/api/v1/welder-uac-second/base-organization/update/',
        delete: '/api/v1/welder-uac-second/base-organization-comb/delete-base-organization/'
      },
      fields: [
        { label: '序号', type: 'index', use: ['table'] },
        {
          label: '部门名称',
          prop: 'name',
          type: 'text',
          labelWidth: '120px',
          maxlength: 20,
          rules: [
            { required: true, message: '请输入部门名称', trigger: 'blur' },
            { min: 2, max: 20, message: '长度在 2 到 20 个字符', trigger: 'blur' }
          ],
          placeholder: '请输入部门名称',
          use: ['table', 'add', 'view', 'edit', 'search']
        },
        {
          prop: 'spaceId',
          defaultValue: this.$store.state.user.space.id,
          use: ['add']
        },
        {
          prop: 'property',
          defaultValue: 1,
          use: ['add']
        },
        { label: '操作', type: 'handle', use: ['table'], handle: ['edit', 'view', 'delete'], tableWidth: 320 }
      ]
    }
  }
}
</script>

<style>

</style>
